package com.liangzhong.model.youngTrain.vo
{
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.goods.vo.OtherGoodVo;

	/**
	 *球童信息vo 
	 * @author lake
	 * 
	 */	
	public class PlayerChildInfoVo
	{
		/**
		 * 位置：1-12，对应不同位置
		 */		
		public var index 			:int ;
		/**
		 * 球员包id
		 */		
		public var pid 				:int;
		/**
		 * 开始成长时间
		 */		
		public var growbegin 		:int;
		/**
		 * 成长时间
		 */		
		public var grow				:int;
		
		public function PlayerChildInfoVo()
		{
		}
		/**
		 *是否成熟 
		 * @return 
		 * 
		 */		
		public function get isGrowComplete():Boolean
		{
			//当前时间
			var curSeconds 		:Number = AppData.getInstance().time;
			//当前时间与开始时间间隔 秒
			var grapTime :Number = curSeconds - growbegin;
			var leftTime :int = grow - grapTime;
			if(leftTime <= 0)
			{
				return true;
			}
			return false;
		}
		/**
		 *获取球童颜色 
		 * @return 
		 * 
		 */		
		public function get color():int
		{
			var otherGood :OtherGoodVo = AppData.getInstance().goodsManager.getOtherById(pid) as OtherGoodVo;
			if(otherGood)
			{
				return otherGood.value;
			}
			return 1;
		}
	}
}